package com.lzy.masshappy.service.impl;

import com.lzy.masshappy.model.entity.User;
import com.lzy.masshappy.model.req.LoginReq;
import com.lzy.masshappy.service.AuthService;
import com.lzy.masshappy.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

@Service
public class AuthServiceImpl implements AuthService {

    private UserService userService;


    @Override
    public String login(LoginReq loginReq) {

        //  根据账号查询用户是否存在
        User user = userService.getByAccount(loginReq.getAccount());
        //  校验用户是否存在
        Assert.notNull(user, "用户不存在");

        return "登录成功";
    }
}
